
ifeq ($(BUILD),release)
CFLAGS=-O3
endif 

ifeq ($(BUILD),debug)
CFLAGS=-g
endif

CC=g++
WARN=-Wall -Wno-write-strings

VXREF_OBJS=str.o tag.o lex.o parse.o lock.o

#all: bin-vxrefserver bin-pipeserver
all: vxrefserver pipeserver

vxrefserver: vxrefserver.cpp $(VXREF_OBJS)
	$(CC) $(CFLAGS) $(WARN)  vxrefserver.cpp $(VXREF_OBJS) -o vxrefserver

pipeserver: pipeserver.cpp
	$(CC) $(CFLAGS) $(WARN) pipeserver.cpp -o pipeserver

clean:
	rm -f pipeserver vxrefserver *.o

%.o: %.cpp %.h
	$(CC) -c $(CFLAGS) $(WARN) $*.cpp -o $*.o

%.o: %.cpp
	$(CC) -c $(CFLAGS) $(WARN) $*.cpp -o $*.o

#%.o: %.cpp
#	$(CC) -c $(CFLAGS) $*.cpp -o $*.o
#
#bin-%: %.o
#	$(CC) $(CFLAGS) $*.cpp $*.o -o $* 
